#!/bin/bash
SHELL_FOLDER=$(cd $(dirname $0);pwd)

check_command(){
    command -v "$1" >/dev/null
    if [ $? -ne 0 ]; then  
        echo "Command not found, please install $1 command and try again."  
        exit 1  
    fi  
}

# check
check_command wget

# delete
rm -rf $SHELL_FOLDER/main.sh

# download
wget https://linuxmirrors.cn/main.sh

# permissions
chmod u+x $SHELL_FOLDER/main.sh
